<?php

namespace App\Http\Requests;


class ChannelProductRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'channel_id' => 'required',
            'discount' => 'required',
            'items.*.channel_api_code' => 'required',
            'items.*.channel_price' => 'required',
            'items.*.product_id' => 'required',
            'items.*.spec_id' => 'required',
            'items.*.channel_id' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'channel_id.required' => '请选择渠道',
            'discount.required' => '请输入折扣',

            'items.*.channel_api_code.required' => '对接编码必须填写',
            'items.*.channel_price.required' => '进价计算有误，请确认原价和折扣没有错',
            'items.*.product_id.required' => '参数有误:product_id',
            'items.*.channel_id.required' => '参数有误:channel_id',
            'items.*.spec_id.required' => '请选择产品',
        ];
    }
}
